from time import sleep

from appium.webdriver.common.mobileby import MobileBy

from HomeWork_PO_Apptest_add_and_delete_members.base.base_page import BasePage



class EditMember2Page(BasePage):
    def click_deletemember(self):
        # 向下滑动页面，点击删除成员，弹窗选确定
        self.driver.find_element_by_android_uiautomator('new UiScrollable(new UiSelector().'
                                                        'scrollable(true).instance(0)).'
                                                        'scrollIntoView(new UiSelector().text("删除成员").instance(0))').click()
        self.driver.find_element(MobileBy.XPATH, "//*[@text='确定']").click()
        sleep(3)

        from HomeWork_PO_Apptest_add_and_delete_members.page.search_member_page import SearchMemberPage
        return SearchMemberPage(self.driver)